home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-desktop-9.10-i386-PL.iso / casper / filesystem.squashfs / var / lib / dpkg / info / vim-common.preinst < prev    next >
Text File  |  2009-09-21  |  795b  |  31 lines

  1. #!/bin/sh
  2. set -e
  3.  
  4. rm_conffile() {
  5.     PKGNAME="$1"
  6.     CONFFILE="$2"
  7.     if [ -e "$CONFFILE" ]; then
  8.         md5sum="$(md5sum "$CONFFILE" | sed -e 's/ .*//')"
  9.         old_md5sum="$(dpkg-query -W -f='${Conffiles}\n' $PKGNAME | sed -n -e "\\' $CONFFILE '{s/ obsolete$//;s/.* //p}")"
  10.         if [ "$md5sum" != "$old_md5sum" ]; then
  11.             echo "Obsolete conffile $CONFFILE has been modified by you."
  12.             echo "Saving as $CONFFILE.dpkg-bak ..."
  13.             mv -f "$CONFFILE" "$CONFFILE".dpkg-bak
  14.         else
  15.             echo "Removing obsolete conffile $CONFFILE ..."
  16.             rm -f "$CONFFILE"
  17.         fi
  18.     fi
  19. }
  20.  
  21. case "$1" in
  22.     install|upgrade)
  23.     if dpkg --compare-versions "$2" le "1:7.1.293-1"; then
  24.         rm_conffile vim-common /etc/vim/vimrc.tiny
  25.     fi
  26. esac
  27.  
  28.  
  29.  
  30. exit 0
  31.